﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Kikooland.Core;

namespace Kikooland
{
    public class Mob : Entity
    {
        private bool leftMove = true;
        private bool rightMove = false;
        
        public Mob()
            : base()
        {
        }

        public override void Update(GameTime gameTime, MouseState mouseState, KeyboardState keyboardState)
        {
            leftMove = !rightMove && (this.Position.X > 50);
            rightMove = !leftMove && (this.Position.X < 600);
            
            if (leftMove)
            {
                this.Position.Translation(new RectangleEx(-5, 0, 0, 0));
            }
            else if (rightMove)
            {
                this.Position.Translation(new RectangleEx(5, 0, 0, 0));
            }
        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            base.Draw(gameTime, spriteBatch);
        }
    }
}
